home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 November / EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso / earcd / util / misc / frodo.lha / src / Main.asm < prev   
Assembly Source File  |  1995-01-25  |  32KB  |  1,524 lines

  1. *
  2. * Main.asm - Hauptprogramm des C64-Emulators/Einstellungsfenster
  3. *
  4. * Copyright (C) 1994-1995 by Christian Bauer
  5. *
  6.  
  7.         MACHINE    68020
  8.  
  9.         INCLUDE    "exec/types.i"
  10.         INCLUDE    "exec/macros.i"
  11.         INCLUDE    "exec/memory.i"
  12.         INCLUDE    "exec/execbase.i"
  13.         INCLUDE    "dos/dos.i"
  14.         INCLUDE    "intuition/intuition.i"
  15.         INCLUDE    "libraries/gadtools.i"
  16.         INCLUDE    "libraries/asl.i"
  17.         INCLUDE    "workbench/workbench.i"
  18.         INCLUDE    "FrodoPrefs.i"
  19.         INCLUDE    "Frodo_rev.i"
  20.  
  21.         XREF    _SysBase    ;Startup
  22.         XREF    _DOSBase
  23.         XDEF    _main
  24.  
  25.         XDEF    _UtilityBase
  26.         XDEF    _IntuitionBase
  27.         XDEF    _GfxBase
  28.         XDEF    _GadToolsBase
  29.         XDEF    _AslBase
  30.         XDEF    _EGSBase
  31.         XDEF    _VilIntuiBase
  32.         XDEF    _CiaBase
  33.         XDEF    _MiscBase
  34.  
  35.         XDEF    ShowPrefs
  36.  
  37.         XDEF    MainTask
  38.  
  39.         XREF    TheRAM        ;6510.asm
  40.         XREF    TheBasic
  41.         XREF    TheKernal
  42.         XREF    TheChar
  43.         XREF    TheColor
  44.         XREF    Init6510
  45.         XREF    Start6510
  46.         XREF    Stop6510
  47.         XREF    Wait6510
  48.         XREF    Pause6510
  49.         XREF    Resume6510
  50.  
  51.         XREF    Reset6526    ;6526.asm
  52.         XREF    ChangedKeys
  53.         XREF    CIACycles
  54.         XREF    Joystick1On
  55.         XREF    Joystick2On
  56.         XREF    JoystickSwap
  57.         XREF    KeyboardYZ
  58.  
  59.         XREF    OpenGraphics    ;6569.asm
  60.         XREF    CloseGraphics
  61.         XREF    WaitForClick
  62.         XREF    AmigaToFront
  63.         XREF    EmulToFront
  64.         XREF    DisplayID
  65.         XREF    ScreenType
  66.         XREF    NormalCycles
  67.         XREF    BadLineCycles
  68.  
  69.         XREF    Reset6581    ;6581.asm
  70.         XREF    UseSIDCard
  71.  
  72.         XREF    Open1541    ;1541.asm
  73.         XREF    Close1541
  74.         XREF    ChangedDirs
  75.         XREF    CloseIEC
  76.         XREF    ChangedIEC
  77.         XREF    Dir8
  78.         XREF    Dir9
  79.         XREF    Dir10
  80.         XREF    Dir11
  81.         XREF    Drv8IsIEC
  82.         XREF    Drv9IsIEC
  83.         XREF    Drv10IsIEC
  84.         XREF    Drv11IsIEC
  85.         XREF    OtherIEC
  86.  
  87.         SECTION    "CODE",CODE
  88.  
  89.  
  90. **
  91. ** Makros
  92. **
  93.  
  94. ; LongInt-Wert aus Integer-Gadget a0 lesen
  95. GetInt        MACRO    ;Ziel
  96.         move.l    gg_SpecialInfo(a0),a0
  97.         move.l    si_LongInt(a0),\1
  98.         ENDM
  99.  
  100.  
  101. **
  102. ** Hauptprogramm
  103. **
  104.  
  105. ; Task holen
  106. _main        move.l    _SysBase,a6
  107.         sub.l    a1,a1
  108.         JSRLIB    FindTask
  109.         move.l    d0,MainTask
  110.  
  111. ; Libraries öffnen
  112.         moveq    #37,d0
  113.         lea    UtilityName,a1
  114.         JSRLIB    OpenLibrary
  115.         move.l    d0,_UtilityBase
  116.         beq    NoUtility
  117.  
  118.         moveq    #37,d0
  119.         lea    IntuiName,a1
  120.         JSRLIB    OpenLibrary
  121.         move.l    d0,_IntuitionBase
  122.         beq    NoIntui
  123.  
  124.         moveq    #37,d0
  125.         lea    GfxName,a1
  126.         JSRLIB    OpenLibrary
  127.         move.l    d0,_GfxBase
  128.         beq    NoGfx
  129.  
  130.         moveq    #37,d0
  131.         lea    GadToolsName,a1
  132.         JSRLIB    OpenLibrary
  133.         move.l    d0,_GadToolsBase
  134.         beq    NoGadTools
  135.  
  136.         moveq    #38,d0
  137.         lea    AslName,a1
  138.         JSRLIB    OpenLibrary
  139.         move.l    d0,_AslBase
  140.         beq    NoAsl
  141.  
  142.         moveq    #37,d0
  143.         lea    IconName,a1
  144.         JSRLIB    OpenLibrary
  145.         move.l    d0,_IconBase
  146.         beq    NoIcon
  147.  
  148.         moveq    #5,d0
  149.         lea    EGSName,a1
  150.         JSRLIB    OpenLibrary
  151.         move.l    d0,_EGSBase
  152.  
  153.         moveq    #2,d0
  154.         lea    VilIntuiName,a1
  155.         JSRLIB    OpenLibrary
  156.         move.l    d0,_VilIntuiBase
  157.  
  158.         lea    CiaResName,a1
  159.         JSRLIB    OpenResource
  160.         move.l    d0,_CiaBase
  161.         beq    NoCiaRes
  162.  
  163.         lea    MiscResName,a1
  164.         JSRLIB    OpenResource
  165.         move.l    d0,_MiscBase
  166.         beq    NoMiscRes
  167.  
  168. ; 68020 vorhanden?
  169.         move.l    _SysBase,a0
  170.         move.w    AttnFlags(a0),d0
  171.         btst    #AFB_68020,d0
  172.         beq    No68020Exit
  173.  
  174. ; ScreenMode- und Directory-Requester holen
  175.         move.l    _AslBase,a6
  176.         moveq    #ASL_ScreenModeRequest,d0
  177.         lea    ScreenReqTags,a0
  178.         JSRLIB    AllocAslRequest
  179.         move.l    d0,ScreenRequester
  180.         beq    NoMemExit
  181.  
  182.         moveq    #ASL_FileRequest,d0
  183.         lea    DirReqTags,a0
  184.         JSRLIB    AllocAslRequest
  185.         move.l    d0,DirRequester
  186.         beq    NoMemExit
  187.  
  188. ; Vorgegebene Einstellungen
  189.         move.w    #63,PNormalCycles
  190.         move.w    #23,PBadLineCycles
  191.         move.w    #63,PCIACycles
  192.         clr.w    PJoystick1On
  193.         move.w    #-1,PJoystick2On
  194.         clr.w    PJoystickSwap
  195.         clr.l    PDisplayID
  196.         clr.w    PScreenType
  197.         clr.b    PDir8
  198.         clr.b    PDir9
  199.         clr.b    PDir10
  200.         clr.b    PDir11
  201.         clr.w    PUseSIDCard
  202.         clr.w    KeyboardYZ
  203.  
  204. ; Einstellungen laden
  205.         move.l    _DOSBase,a6
  206.         move.l    #PrefsFileName,d1
  207.         move.l    #MODE_OLDFILE,d2
  208.         JSRLIB    Open
  209.         move.l    d0,d7
  210.         beq    NoEmulPrefs
  211.  
  212.         move.l    d7,d1
  213.         move.l    #ThePrefs,d2
  214.         move.l    #PrefsLength,d3
  215.         JSRLIB    Read
  216.  
  217.         move.l    d7,d1
  218.         JSRLIB    Close
  219. NoEmulPrefs
  220.  
  221. ; Einstellungsfenster darstellen
  222.         clr.w    PrefsFromEmul
  223.         bsr    DoThePrefs
  224.  
  225. ; Einstellungen übernehmen, wenn OK geklickt, sonst beenden
  226.         tst.l    d7
  227.         beq    Exit
  228.         bsr    SetPrefs
  229.  
  230. ; Tastaturbelegung einstellen
  231.         jsr    ChangedKeys
  232.  
  233. ; Dateikram vorbereiten
  234.         jsr    Open1541
  235.         jsr    ChangedIEC
  236.         bsr    IECErrorReq
  237.  
  238. ; Speicher für alles holen (die unteren Worte müssen mit den C64-Adressen
  239. ; übereinstimmen, außer CharROM)
  240.         move.l    _SysBase,a6
  241.         move.l    #$30000,d0        ;192K
  242.         move.l    #MEMF_ANY|MEMF_CLEAR,d1
  243.         JSRLIB    AllocVec
  244.         move.l    d0,RAMBlock
  245.         beq    NoMemExit
  246.  
  247.         add.l    #$ffff,d0        ;Auf xxxx0000 bringen
  248.         clr.w    d0
  249.         move.l    d0,TheRAM
  250.         add.l    #$11000,d0
  251.         move.l    d0,TheChar        ;yyyy1000
  252.         add.l    #$9000,d0
  253.         move.l    d0,TheBasic        ;yyyya000
  254.         add.l    #$3800,d0
  255.         move.l    d0,TheColor        ;yyyyd800
  256.         add.l    #$0800,d0
  257.         move.l    d0,TheKernal        ;yyyye000
  258.  
  259. ; Sprungbefehl bei $10000 installieren,
  260. ; für den Fall, daß ein Programm den Wraparound bei $ffff macht
  261.         move.l    TheRAM,a0
  262.         move.l    #$4c000000,$10000(a0)
  263.  
  264. ; ROMs laden
  265.         move.l    _DOSBase,a6
  266.         move.l    #BasicFileName,d1    ;Basic
  267.         move.l    #MODE_OLDFILE,d2
  268.         JSRLIB    Open
  269.         move.l    d0,d7
  270.         beq    NoBasicExit
  271.         move.l    d0,d1
  272.         move.l    TheBasic,d2
  273.         move.l    #$2000,d3
  274.         JSRLIB    Read
  275.         move.l    d7,d1
  276.         JSRLIB    Close
  277.  
  278.         move.l    #KernalFileName,d1    ;Kernal
  279.         move.l    #MODE_OLDFILE,d2
  280.         JSRLIB    Open
  281.         move.l    d0,d7
  282.         beq    NoKernalExit
  283.         move.l    d0,d1
  284.         move.l    TheKernal,d2
  285.         move.l    #$2000,d3
  286.         JSRLIB    Read
  287.         move.l    d7,d1
  288.         JSRLIB    Close
  289.  
  290.         move.l    #CharFileName,d1    ;Char
  291.         move.l    #MODE_OLDFILE,d2
  292.         JSRLIB    Open
  293.         move.l    d0,d7
  294.         beq    NoCharExit
  295.         move.l    d0,d1
  296.         move.l    TheChar,d2
  297.         move.l    #$1000,d3
  298.         JSRLIB    Read
  299.         move.l    d7,d1
  300.         JSRLIB    Close
  301.  
  302. ; Betriebssystem patchen
  303.         move.l    TheKernal,a0
  304.         move.w    #$f200,$0d40(a0)    ;IECOut
  305.         move.w    #$f201,$0d23(a0)    ;IECOutATN
  306.         move.w    #$f202,$0d36(a0)    ;IECOutSec
  307.         move.w    #$f203,$0e13(a0)    ;IECIn
  308.         move.w    #$f204,$0def(a0)    ;IECSetATN
  309.         move.w    #$f205,$0dbe(a0)    ;IECRelATN
  310.         move.w    #$f206,$0dcc(a0)    ;IECTurnaround
  311.         move.w    #$f207,$0e03(a0)    ;IECRelease
  312.  
  313. ; Bildschirm öffnen
  314.         jsr    OpenGraphics
  315.         cmp.l    #1,d0
  316.         beq    NoScreenExit
  317.         cmp.l    #2,d0
  318.         beq    NoMemExit
  319.         cmp.l    #3,d0
  320.         beq    NoEGSExit
  321.         cmp.l    #4,d0
  322.         beq    NoVilIntuiExit
  323.         cmp.l    #5,d0
  324.         beq    NoDisplayIDExit
  325.         cmp.l    #6,d0
  326.         beq    ScrTooSmallExit
  327.  
  328. ; Alles initialisieren
  329.         jsr    Reset6526
  330.         jsr    Reset6581
  331.         jsr    Init6510
  332.  
  333. ; 6510 starten
  334.         jsr    Start6510
  335.         tst.l    d0
  336.         bne    NoMemExit
  337.  
  338. ; Auf Mausklick warten
  339.         jsr    WaitForClick
  340.  
  341. ; Programm beenden
  342.         bra    Exit
  343.  
  344. *
  345. * Fehlerbehandlung/Beenden
  346. *
  347.  
  348.         MACHINE    68000
  349.  
  350. No68020Exit    lea    No68020Req,a1
  351.         move.l    _IntuitionBase,a6
  352.         sub.l    a0,a0
  353.         move.l    a0,a2
  354.         move.l    a0,a3
  355.         JSRLIB    EasyRequestArgs
  356.         bra    NoCiaRes
  357.  
  358.         MACHINE    68020
  359.  
  360. NoMemExit    lea    NoMemReq,a1
  361.         bra    ReqExit
  362.  
  363. NoScreenExit    lea    NoScreenReq,a1
  364.         bra    ReqExit
  365.  
  366. NoEGSExit    lea    NoEGSReq,a1
  367.         bra    ReqExit
  368.  
  369. NoVilIntuiExit    lea    NoVilIntuiReq,a1
  370.         bra    ReqExit
  371.  
  372. NoDisplayIDExit    lea    NoDisplayIDReq,a1
  373.         bra    ReqExit
  374.  
  375. ScrTooSmallExit    lea    ScrTooSmallReq,a1
  376.         bra    ReqExit
  377.  
  378. NoKernalExit    lea    NoKernalReq,a1
  379.         bra    ReqExit
  380.  
  381. NoBasicExit    lea    NoBasicReq,a1
  382.         bra    ReqExit
  383.  
  384. NoCharExit    lea    NoCharReq,a1
  385.  
  386. ReqExit        move.l    _IntuitionBase,a6
  387.         sub.l    a0,a0
  388.         move.l    a0,a2
  389.         move.l    a0,a3
  390.         JSRLIB    EasyRequestArgs
  391.  
  392. Exit        jsr    Stop6510
  393.         jsr    Reset6581    ;Stoppt diesen Lärm!
  394.         jsr    CloseGraphics
  395.         jsr    CloseIEC
  396.         jsr    Close1541
  397.  
  398.         move.l    _SysBase,a6
  399.  
  400.         move.l    RAMBlock,d0
  401.         beq    1$
  402.         move.l    d0,a1
  403.         JSRLIB    FreeVec
  404.  
  405. 1$        move.l    DirRequester,d0
  406.         beq    2$
  407.         move.l    _AslBase,a6
  408.         move.l    d0,a0
  409.         JSRLIB    FreeAslRequest
  410.  
  411. 2$        move.l    ScreenRequester,d0
  412.         beq    3$
  413.         move.l    _AslBase,a6
  414.         move.l    d0,a0
  415.         JSRLIB    FreeAslRequest
  416.  
  417. 3$
  418.         MACHINE    68000
  419.  
  420. NoMiscRes
  421. NoCiaRes    move.l    _SysBase,a6
  422.         move.l    _VilIntuiBase,d0
  423.         beq    NoVilIntui
  424.         move.l    d0,a1
  425.         JSRLIB    CloseLibrary
  426. NoVilIntui    move.l    _EGSBase,d0
  427.         beq    NoEGS
  428.         move.l    d0,a1
  429.         JSRLIB    CloseLibrary
  430. NoEGS        move.l    _IconBase,a1
  431.         JSRLIB    CloseLibrary
  432. NoIcon        move.l    _AslBase,a1
  433.         JSRLIB    CloseLibrary
  434. NoAsl        move.l    _GadToolsBase,a1
  435.         JSRLIB    CloseLibrary
  436. NoGadTools    move.l    _GfxBase,a1
  437.         JSRLIB    CloseLibrary
  438. NoGfx        move.l    _IntuitionBase,a1
  439.         JSRLIB    CloseLibrary
  440. NoIntui        move.l    _UtilityBase,a1
  441.         JSRLIB    CloseLibrary
  442. NoUtility    moveq    #0,d0
  443.         rts
  444.  
  445.         MACHINE    68020
  446.  
  447.  
  448. **
  449. ** Preferences
  450. **
  451.  
  452. *
  453. * Preferences aus dem Emulator heraus
  454. *
  455.  
  456. ; C64 anhalten und nach hinten legen
  457. ShowPrefs    jsr    Pause6510
  458.         jsr    AmigaToFront
  459.  
  460. ; Aktuelle Preferences holen
  461.         bsr    GetPrefs
  462.  
  463. ; Fenster öffnen und handhaben
  464.         move.w    #-1,PrefsFromEmul
  465.         bsr    DoThePrefs
  466.  
  467. ; Prefs setzen, wenn OK geklickt
  468.         tst.l    d7
  469.         beq    1$
  470.         bsr    SetPrefs
  471.         jsr    ChangedKeys
  472.         jsr    ChangedDirs
  473.         jsr    ChangedIEC
  474.         bsr    IECErrorReq
  475. 1$
  476.  
  477. ; C64 nach vorn holen und wieder starten
  478.         jsr    EmulToFront
  479.         jsr    Resume6510
  480.         rts
  481.  
  482. *
  483. * Handhabung des Preferences-Fensters
  484. *
  485.  
  486. ; Fenster öffnen
  487. DoThePrefs    jsr    SetupScreen
  488.         tst.l    d0
  489.         bne    PrefsError
  490.         jsr    OpenPrefsWindow
  491.         tst.l    d0
  492.         bne    PrefsError
  493.         bsr    SetGadgets
  494.         move.l    PrefsWnd,ScreenReqWindow
  495.         move.l    PrefsWnd,DirReqWindow
  496.  
  497. ; EventLoop
  498. EventLoop    move.l    _SysBase,a6
  499.         move.l    PrefsWnd,a0
  500.         move.l    wd_UserPort(a0),a0
  501.         JSRLIB    WaitPort
  502.  
  503. GetEvent    move.l    _GadToolsBase,a6
  504.         move.l    PrefsWnd,a0
  505.         move.l    wd_UserPort(a0),a0
  506.         JSRLIB    GT_GetIMsg
  507.         tst.l    d0
  508.         beq    EventLoop
  509.  
  510.         move.l    d0,a1
  511.         move.l    im_Class(a1),TheClass
  512.         move.w    im_Code(a1),TheCode
  513.         move.l    im_IAddress(a1),TheGadget
  514.         JSRLIB    GT_ReplyIMsg
  515.  
  516. ; Klasse auswerten
  517.         move.l    TheClass,d0
  518.         and.l    #IDCMP_GADGETUP,d0
  519.         beq    NotGadget
  520.  
  521. ; GadgetUp
  522.         move.l    TheGadget,a0
  523.  
  524. ; OK
  525.         cmp.w    #GD_OK,gg_GadgetID(a0)
  526.         bne    1$
  527.         moveq    #-1,d7
  528.         bra    PrefsDone
  529.  
  530. ; Cancel
  531. 1$        cmp.w    #GD_Cancel,gg_GadgetID(a0)
  532.         bne    2$
  533.         moveq    #0,d7
  534.         bra    PrefsDone
  535.  
  536. ; Save
  537. 2$        cmp.w    #GD_Save,gg_GadgetID(a0)
  538.         bne    4$
  539.         bsr    SaveThePrefs
  540.         bra    GetEvent
  541.  
  542. ; Joystick1On
  543. 4$        cmp.w    #GD_Joystick1On,gg_GadgetID(a0)
  544.         bne    5$
  545.         not.w    PJoystick1On
  546.         bra    GetEvent
  547.  
  548. ; Joystick2On
  549. 5$        cmp.w    #GD_Joystick2On,gg_GadgetID(a0)
  550.         bne    6$
  551.         not.w    PJoystick2On
  552.         bra    GetEvent
  553.  
  554. ; JoystickSwap
  555. 6$        cmp.w    #GD_JoystickSwap,gg_GadgetID(a0)
  556.         bne    7$
  557.         not.w    PJoystickSwap
  558.         bra    GetEvent
  559.  
  560. ; GetDisplayID
  561. 7$        cmp.w    #GD_GetDisplayID,gg_GadgetID(a0)
  562.         bne    8$
  563.         tst.w    PrefsFromEmul        ;Nur beim Start
  564.         bne    GetEvent
  565.         move.l    _AslBase,a6
  566.         move.l    ScreenRequester,a0
  567.         move.l    PDisplayID,ScreenReqID
  568.         lea    DoScreenReqTags,a1
  569.         JSRLIB    AslRequest
  570.         tst.l    d0
  571.         beq    GetEvent
  572.  
  573.         move.l    ScreenRequester,a0
  574.         move.l    sm_DisplayID(a0),PDisplayID
  575.         bsr    SetDisplayIDGad
  576.         bra    GetEvent
  577.  
  578. ; ScreenType
  579. 8$        cmp.w    #GD_ScreenType,gg_GadgetID(a0)
  580.         bne    9$
  581.         tst.w    PrefsFromEmul        ;Nur beim Start
  582.         bne    GetEvent
  583.         move.w    TheCode,PScreenType
  584.         bra    GetEvent
  585.  
  586. ; Use SID Card
  587. 9$        cmp.w    #GD_UseSIDCard,gg_GadgetID(a0)
  588.         bne    10$
  589.         not.w    PUseSIDCard
  590.         bra    GetEvent
  591.  
  592. ; Drive 8 is on IEC cable
  593. 10$        cmp.w    #GD_Drv8IsIEC,gg_GadgetID(a0)
  594.         bne    11$
  595.         not.w    PDrv8IsIEC
  596.         beq    101$
  597.         lea    DisableTags,a3
  598.         bra    102$
  599. 101$        lea    EnableTags,a3
  600. 102$        lea    PrefsGadgets,a0
  601.         move.l    GDX_Dir8*4(a0),a0
  602.         move.l    PrefsWnd,a1
  603.         sub.l    a2,a2
  604.         JSRLIB    GT_SetGadgetAttrsA
  605.         bra    GetEvent
  606.  
  607. ; Drive 9 is on IEC cable
  608. 11$        cmp.w    #GD_Drv9IsIEC,gg_GadgetID(a0)
  609.         bne    12$
  610.         not.w    PDrv9IsIEC
  611.         beq    111$
  612.         lea    DisableTags,a3
  613.         bra    112$
  614. 111$        lea    EnableTags,a3
  615. 112$        lea    PrefsGadgets,a0
  616.         move.l    GDX_Dir9*4(a0),a0
  617.         move.l    PrefsWnd,a1
  618.         sub.l    a2,a2
  619.         JSRLIB    GT_SetGadgetAttrsA
  620.         bra    GetEvent
  621.  
  622. ; Drive 10 is on IEC cable
  623. 12$        cmp.w    #GD_Drv10IsIEC,gg_GadgetID(a0)
  624.         bne    13$
  625.         not.w    PDrv10IsIEC
  626.         beq    121$
  627.         lea    DisableTags,a3
  628.         bra    122$
  629. 121$        lea    EnableTags,a3
  630. 122$        lea    PrefsGadgets,a0
  631.         move.l    GDX_Dir10*4(a0),a0
  632.         move.l    PrefsWnd,a1
  633.         sub.l    a2,a2
  634.         JSRLIB    GT_SetGadgetAttrsA
  635.         bra    GetEvent
  636.  
  637. ; Drive 11 is on IEC cable
  638. 13$        cmp.w    #GD_Drv11IsIEC,gg_GadgetID(a0)
  639.         bne    14$
  640.         not.w    PDrv11IsIEC
  641.         beq    131$
  642.         lea    DisableTags,a3
  643.         bra    132$
  644. 131$        lea    EnableTags,a3
  645. 132$        lea    PrefsGadgets,a0
  646.         move.l    GDX_Dir11*4(a0),a0
  647.         move.l    PrefsWnd,a1
  648.         sub.l    a2,a2
  649.         JSRLIB    GT_SetGadgetAttrsA
  650.         bra    GetEvent
  651.  
  652. ; Get Directory for drive 8
  653. 14$        cmp.w    #GD_GetDir8,gg_GadgetID(a0)
  654.         bne    15$
  655.         lea    SetDir8Tags,a3
  656.         lea    PDir8,a4
  657.         move.l    #GD_Dir8,d4
  658.         bsr    DoGetDirName
  659.         bra    GetEvent
  660.  
  661. ; Get Directory for drive 9
  662. 15$        cmp.w    #GD_GetDir9,gg_GadgetID(a0)
  663.         bne    16$
  664.         lea    SetDir9Tags,a3
  665.         lea    PDir9,a4
  666.         move.l    #GD_Dir9,d4
  667.         bsr    DoGetDirName
  668.         bra    GetEvent
  669.  
  670. ; Get Directory for drive 10
  671. 16$        cmp.w    #GD_GetDir10,gg_GadgetID(a0)
  672.         bne    17$
  673.         lea    SetDir10Tags,a3
  674.         lea    PDir10,a4
  675.         move.l    #GD_Dir10,d4
  676.         bsr    DoGetDirName
  677.         bra    GetEvent
  678.  
  679. ; Get Directory for drive 11
  680. 17$        cmp.w    #GD_GetDir11,gg_GadgetID(a0)
  681.         bne    18$
  682.         lea    SetDir11Tags,a3
  683.         lea    PDir11,a4
  684.         move.l    #GD_Dir11,d4
  685.         bsr    DoGetDirName
  686.         bra    GetEvent
  687.  
  688. ; Use IEC cable for device numbers 4-15
  689. 18$        cmp.w    #GD_OtherIEC,gg_GadgetID(a0)
  690.         bne    19$
  691.         not.w    POtherIEC
  692.         bra    GetEvent
  693.  
  694. ; American keyboard layout
  695. 19$        cmp.w    #GD_KeyboardYZ,gg_GadgetID(a0)
  696.         bne    20$
  697.         not.w    PKeyboardYZ
  698.         bra    GetEvent
  699.  
  700. 20$        bra    GetEvent
  701.  
  702. ; Refresh
  703. NotGadget    move.l    TheClass,d0
  704.         and.l    #IDCMP_REFRESHWINDOW,d0
  705.         beq    NotRefresh
  706.         move.l    PrefsWnd,a0
  707.         JSRLIB    GT_BeginRefresh
  708.         move.l    PrefsWnd,a0
  709.         moveq    #-1,d0
  710.         JSRLIB    GT_EndRefresh
  711.         bra    GetEvent
  712.  
  713. ; Tastatur
  714. NotRefresh    move.l    TheClass,d0
  715.         and.l    #IDCMP_VANILLAKEY,d0
  716.         beq    GetEvent
  717.  
  718.         cmp.w    #'o',TheCode        ;O - OK
  719.         bne    1$
  720.         moveq    #-1,d7
  721.         bra    PrefsDone
  722.  
  723. 1$        cmp.w    #'s',TheCode        ;S - Save
  724.         bne    2$
  725.         bsr    SaveThePrefs
  726.         bra    GetEvent
  727.  
  728. 2$        cmp.w    #'c',TheCode        ;C - Cancel
  729.         bne    3$
  730.         moveq    #0,d7
  731.         bra    PrefsDone
  732.  
  733. 3$        bra    GetEvent
  734.  
  735. ; Fertig mit den Prefs
  736. PrefsDone    bsr    GetGadgets
  737.         jsr    ClosePrefsWindow
  738. PrefsError    jsr    CloseDownScreen
  739.         rts
  740.  
  741. *
  742. * Auswahl eines Verzeichnisses
  743. * a3: Zeiger auf Tags zum Ändern des zugehörigen Stringgadgets
  744. * a4: Zeiger auf Puffer für Namen (256 Bytes)
  745. * d4: ID des Stringgadgets, das anschließend geändert werden soll
  746. *
  747.  
  748. DoGetDirName    move.l    a4,a0            ;Verzeichnisname kopieren
  749.         lea    DirName,a1
  750.         moveq    #256/4-1,d0
  751. 1$        move.l    (a0)+,(a1)+
  752.         dbra    d0,1$
  753.  
  754.         move.l    _AslBase,a6        ;Requester darstellen
  755.         move.l    DirRequester,a0
  756.         lea    DoDirReqTags,a1
  757.         JSRLIB    AslRequest
  758.         tst.l    d0
  759.         beq    3$
  760.  
  761.         move.l    DirRequester,a0        ;OK geklickt, Name zurückkopieren
  762.         move.l    fr_Drawer(a0),a0
  763.         move.l    a4,a1
  764.         moveq    #256/4-1,d0
  765. 2$        move.l    (a0)+,(a1)+
  766.         dbra    d0,2$
  767.  
  768.         move.l    _GadToolsBase,a6    ;Name-Gadget neu setzen
  769.         lea    PrefsGadgets,a0
  770.         move.l    (a0,d4.w*4),a0
  771.         move.l    PrefsWnd,a1
  772.         sub.l    a2,a2            ;a3 enthält bereits den Zeiger auf die Tags
  773.         JSRLIB    GT_SetGadgetAttrsA
  774.  
  775. 3$        rts
  776.  
  777. *
  778. * Gadgets setzen
  779. *
  780.  
  781. SetGadgets    move.l    _GadToolsBase,a6
  782.         lea    PrefsGadgets,a5
  783.  
  784.         move.l    GDX_NormalCycles*4(a5),a0
  785.         move.l    PrefsWnd,a1
  786.         sub.l    a2,a2
  787.         lea    SetIntegerTags,a3
  788.         moveq    #0,d0
  789.         move.w    PNormalCycles,d0
  790.         move.l    d0,SetIntTagsVal
  791.         JSRLIB    GT_SetGadgetAttrsA
  792.  
  793.         move.l    GDX_BadLineCycles*4(a5),a0
  794.         move.l    PrefsWnd,a1
  795.         sub.l    a2,a2
  796.         lea    SetIntegerTags,a3
  797.         moveq    #0,d0
  798.         move.w    PBadLineCycles,d0
  799.         move.l    d0,SetIntTagsVal
  800.         JSRLIB    GT_SetGadgetAttrsA
  801.  
  802.         move.l    GDX_CIACycles*4(a5),a0
  803.         move.l    PrefsWnd,a1
  804.         sub.l    a2,a2
  805.         lea    SetIntegerTags,a3
  806.         moveq    #0,d0
  807.         move.w    PCIACycles,d0
  808.         move.l    d0,SetIntTagsVal
  809.         JSRLIB    GT_SetGadgetAttrsA
  810.  
  811.         tst.w    PJoystick1On
  812.         beq    2$
  813.         move.l    GDX_Joystick1On*4(a5),a0
  814.         move.l    PrefsWnd,a1
  815.         sub.l    a2,a2
  816.         lea    SetCheckTags,a3
  817.         JSRLIB    GT_SetGadgetAttrsA
  818.  
  819. 2$        tst.w    PJoystick2On
  820.         beq    3$
  821.         move.l    GDX_Joystick2On*4(a5),a0
  822.         move.l    PrefsWnd,a1
  823.         sub.l    a2,a2
  824.         lea    SetCheckTags,a3
  825.         JSRLIB    GT_SetGadgetAttrsA
  826.  
  827. 3$        tst.w    PJoystickSwap
  828.         beq    4$
  829.         move.l    GDX_JoystickSwap*4(a5),a0
  830.         move.l    PrefsWnd,a1
  831.         sub.l    a2,a2
  832.         lea    SetCheckTags,a3
  833.         JSRLIB    GT_SetGadgetAttrsA
  834.  
  835. 4$        tst.w    PUseSIDCard
  836.         beq    5$
  837.         move.l    GDX_UseSIDCard*4(a5),a0
  838.         move.l    PrefsWnd,a1
  839.         sub.l    a2,a2
  840.         lea    SetCheckTags,a3
  841.         JSRLIB    GT_SetGadgetAttrsA
  842.  
  843. 5$        tst.w    PDrv8IsIEC
  844.         beq    6$
  845.         move.l    GDX_Drv8IsIEC*4(a5),a0
  846.         move.l    PrefsWnd,a1
  847.         sub.l    a2,a2
  848.         lea    SetCheckTags,a3
  849.         JSRLIB    GT_SetGadgetAttrsA
  850.  
  851.         move.l    GDX_Dir8*4(a5),a0
  852.         move.l    PrefsWnd,a1
  853.         sub.l    a2,a2
  854.         lea    DisableTags,a3
  855.         JSRLIB    GT_SetGadgetAttrsA
  856.  
  857. 6$        tst.w    PDrv9IsIEC
  858.         beq    7$
  859.         move.l    GDX_Drv9IsIEC*4(a5),a0
  860.         move.l    PrefsWnd,a1
  861.         sub.l    a2,a2
  862.         lea    SetCheckTags,a3
  863.         JSRLIB    GT_SetGadgetAttrsA
  864.  
  865.         move.l    GDX_Dir9*4(a5),a0
  866.         move.l    PrefsWnd,a1
  867.         sub.l    a2,a2
  868.         lea    DisableTags,a3
  869.         JSRLIB    GT_SetGadgetAttrsA
  870.  
  871. 7$        tst.w    PDrv10IsIEC
  872.         beq    8$
  873.         move.l    GDX_Drv10IsIEC*4(a5),a0
  874.         move.l    PrefsWnd,a1
  875.         sub.l    a2,a2
  876.         lea    SetCheckTags,a3
  877.         JSRLIB    GT_SetGadgetAttrsA
  878.  
  879.         move.l    GDX_Dir10*4(a5),a0
  880.         move.l    PrefsWnd,a1
  881.         sub.l    a2,a2
  882.         lea    DisableTags,a3
  883.         JSRLIB    GT_SetGadgetAttrsA
  884.  
  885. 8$        tst.w    PDrv11IsIEC
  886.         beq    9$
  887.         move.l    GDX_Drv11IsIEC*4(a5),a0
  888.         move.l    PrefsWnd,a1
  889.         sub.l    a2,a2
  890.         lea    SetCheckTags,a3
  891.         JSRLIB    GT_SetGadgetAttrsA
  892.  
  893.         move.l    GDX_Dir11*4(a5),a0
  894.         move.l    PrefsWnd,a1
  895.         sub.l    a2,a2
  896.         lea    DisableTags,a3
  897.         JSRLIB    GT_SetGadgetAttrsA
  898.  
  899. 9$        tst.w    POtherIEC
  900.         beq    10$
  901.         move.l    GDX_OtherIEC*4(a5),a0
  902.         move.l    PrefsWnd,a1
  903.         sub.l    a2,a2
  904.         lea    SetCheckTags,a3
  905.         JSRLIB    GT_SetGadgetAttrsA
  906.  
  907. 10$        tst.w    PKeyboardYZ
  908.         beq    11$
  909.         move.l    GDX_KeyboardYZ*4(a5),a0
  910.         move.l    PrefsWnd,a1
  911.         sub.l    a2,a2
  912.         lea    SetCheckTags,a3
  913.         JSRLIB    GT_SetGadgetAttrsA
  914.  
  915. 11$        move.l    GDX_ScreenType*4(a5),a0
  916.         move.l    PrefsWnd,a1
  917.         sub.l    a2,a2
  918.         lea    SetCycleTags,a3
  919.         moveq    #0,d0
  920.         move.w    PScreenType,d0
  921.         move.l    d0,SetCycTagsVal
  922.         JSRLIB    GT_SetGadgetAttrsA
  923.  
  924.         move.l    GDX_Dir8*4(a5),a0
  925.         move.l    PrefsWnd,a1
  926.         sub.l    a2,a2
  927.         lea    SetDir8Tags,a3
  928.         JSRLIB    GT_SetGadgetAttrsA
  929.  
  930.         move.l    GDX_Dir9*4(a5),a0
  931.         move.l    PrefsWnd,a1
  932.         sub.l    a2,a2
  933.         lea    SetDir9Tags,a3
  934.         JSRLIB    GT_SetGadgetAttrsA
  935.  
  936.         move.l    GDX_Dir10*4(a5),a0
  937.         move.l    PrefsWnd,a1
  938.         sub.l    a2,a2
  939.         lea    SetDir10Tags,a3
  940.         JSRLIB    GT_SetGadgetAttrsA
  941.  
  942.         move.l    GDX_Dir11*4(a5),a0
  943.         move.l    PrefsWnd,a1
  944.         sub.l    a2,a2
  945.         lea    SetDir11Tags,a3
  946.         JSRLIB    GT_SetGadgetAttrsA
  947.  
  948.         tst.w    PrefsFromEmul        ;Vom Emulator aufgerufen:
  949.         beq    1$            ; Bildschirmtyp und -modus
  950.         move.l    GDX_GetDisplayID*4(a5),a0 ; ausschalten
  951.         move.l    PrefsWnd,a1
  952.         sub.l    a2,a2
  953.         lea    DisableTags,a3
  954.         JSRLIB    GT_SetGadgetAttrsA
  955.  
  956.         move.l    GDX_ScreenType*4(a5),a0
  957.         move.l    PrefsWnd,a1
  958.         sub.l    a2,a2
  959.         lea    DisableTags,a3
  960.         JSRLIB    GT_SetGadgetAttrsA
  961.  
  962. 1$        bra    SetDisplayIDGad
  963.  
  964. *
  965. * DisplayID-Gadget setzen
  966. *
  967.  
  968. SetDisplayIDGad move.l    _GfxBase,a6        ;DisplayID
  969.         sub.l    a0,a0
  970.         lea    ModeNameBuf,a1
  971.         moveq    #nif_SIZEOF,d0
  972.         move.l    #DTAG_NAME,d1
  973.         move.l    PDisplayID,d2
  974.         JSRLIB    GetDisplayInfoData
  975.         move.l    _GadToolsBase,a6
  976.         lea    PrefsGadgets,a0
  977.         move.l    GDX_DisplayID*4(a0),a0
  978.         move.l    PrefsWnd,a1
  979.         sub.l    a2,a2
  980.         lea    SetDIDTags,a3
  981.         JMPLIB    GT_SetGadgetAttrsA
  982.  
  983. *
  984. * Gadgets holen
  985. *
  986.  
  987. GetGadgets    lea    PrefsGadgets,a1
  988.         move.l    GDX_NormalCycles*4(a1),a0
  989.         GetInt    d0
  990.         move.w    d0,PNormalCycles
  991.  
  992.         move.l    GDX_BadLineCycles*4(a1),a0
  993.         GetInt    d0
  994.         move.w    d0,PBadLineCycles
  995.  
  996.         move.l    GDX_CIACycles*4(a1),a0
  997.         GetInt    d0
  998.         move.w    d0,PCIACycles
  999.  
  1000.         move.l    GDX_Dir8*4(a1),a0
  1001.         move.l    gg_SpecialInfo(a0),a0
  1002.         move.l    si_Buffer(a0),a0
  1003.         lea    PDir8,a2
  1004.         moveq    #256/4-1,d0
  1005. 11$        move.l    (a0)+,(a2)+
  1006.         dbra    d0,11$
  1007.  
  1008.         move.l    GDX_Dir9*4(a1),a0
  1009.         move.l    gg_SpecialInfo(a0),a0
  1010.         move.l    si_Buffer(a0),a0
  1011.         lea    PDir9,a2
  1012.         moveq    #256/4-1,d0
  1013. 12$        move.l    (a0)+,(a2)+
  1014.         dbra    d0,12$
  1015.  
  1016.         move.l    GDX_Dir10*4(a1),a0
  1017.         move.l    gg_SpecialInfo(a0),a0
  1018.         move.l    si_Buffer(a0),a0
  1019.         lea    PDir10,a2
  1020.         moveq    #256/4-1,d0
  1021. 13$        move.l    (a0)+,(a2)+
  1022.         dbra    d0,13$
  1023.  
  1024.         move.l    GDX_Dir11*4(a1),a0
  1025.         move.l    gg_SpecialInfo(a0),a0
  1026.         move.l    si_Buffer(a0),a0
  1027.         lea    PDir11,a2
  1028.         moveq    #256/4-1,d0
  1029. 14$        move.l    (a0)+,(a2)+
  1030.         dbra    d0,14$
  1031.         rts
  1032.  
  1033. *
  1034. * Einstellungen setzen
  1035. *
  1036.  
  1037. SetPrefs    move.w    PNormalCycles,NormalCycles
  1038.         move.w    PBadLineCycles,BadLineCycles
  1039.         move.w    PCIACycles,CIACycles
  1040.         move.w    PJoystick1On,Joystick1On
  1041.         move.w    PJoystick2On,Joystick2On
  1042.         move.w    PJoystickSwap,JoystickSwap
  1043.         move.w    PUseSIDCard,UseSIDCard
  1044.         move.w    PDrv8IsIEC,Drv8IsIEC
  1045.         move.w    PDrv9IsIEC,Drv9IsIEC
  1046.         move.w    PDrv10IsIEC,Drv10IsIEC
  1047.         move.w    PDrv11IsIEC,Drv11IsIEC
  1048.         move.w    POtherIEC,OtherIEC
  1049.         move.w    PKeyboardYZ,KeyboardYZ
  1050.         tst.w    PrefsFromEmul
  1051.         bne    1$
  1052.         move.l    PDisplayID,DisplayID    ;Nur beim Start
  1053.         move.w    PScreenType,ScreenType
  1054. 1$
  1055.         lea    PDir8,a0
  1056.         lea    Dir8,a1
  1057.         moveq    #256/4-1,d0
  1058. 11$        move.l    (a0)+,(a1)+
  1059.         dbra    d0,11$
  1060.  
  1061.         lea    PDir9,a0
  1062.         lea    Dir9,a1
  1063.         moveq    #256/4-1,d0
  1064. 12$        move.l    (a0)+,(a1)+
  1065.         dbra    d0,12$
  1066.  
  1067.         lea    PDir10,a0
  1068.         lea    Dir10,a1
  1069.         moveq    #256/4-1,d0
  1070. 13$        move.l    (a0)+,(a1)+
  1071.         dbra    d0,13$
  1072.  
  1073.         lea    PDir11,a0
  1074.         lea    Dir11,a1
  1075.         moveq    #256/4-1,d0
  1076. 14$        move.l    (a0)+,(a1)+
  1077.         dbra    d0,14$
  1078.         rts
  1079.  
  1080. *
  1081. * Einstellungen holen
  1082. *
  1083.  
  1084. GetPrefs    move.w    NormalCycles,PNormalCycles
  1085.         move.w    BadLineCycles,PBadLineCycles
  1086.         move.w    CIACycles,PCIACycles
  1087.         move.w    Joystick1On,PJoystick1On
  1088.         move.w    Joystick2On,PJoystick2On
  1089.         move.w    JoystickSwap,PJoystickSwap
  1090.         move.w    UseSIDCard,PUseSIDCard
  1091.         move.w    Drv8IsIEC,PDrv8IsIEC
  1092.         move.w    Drv9IsIEC,PDrv9IsIEC
  1093.         move.w    Drv10IsIEC,PDrv10IsIEC
  1094.         move.w    Drv11IsIEC,PDrv11IsIEC
  1095.         move.w    OtherIEC,POtherIEC
  1096.         move.w    KeyboardYZ,PKeyboardYZ
  1097.         move.l    DisplayID,PDisplayID
  1098.         move.w    ScreenType,PScreenType
  1099.  
  1100.         lea    Dir8,a0
  1101.         lea    PDir8,a1
  1102.         moveq    #256/4-1,d0
  1103. 11$        move.l    (a0)+,(a1)+
  1104.         dbra    d0,11$
  1105.  
  1106.         lea    Dir9,a0
  1107.         lea    PDir9,a1
  1108.         moveq    #256/4-1,d0
  1109. 12$        move.l    (a0)+,(a1)+
  1110.         dbra    d0,12$
  1111.  
  1112.         lea    Dir10,a0
  1113.         lea    PDir10,a1
  1114.         moveq    #256/4-1,d0
  1115. 13$        move.l    (a0)+,(a1)+
  1116.         dbra    d0,13$
  1117.  
  1118.         lea    Dir11,a0
  1119.         lea    PDir11,a1
  1120.         moveq    #256/4-1,d0
  1121. 14$        move.l    (a0)+,(a1)+
  1122.         dbra    d0,14$
  1123.         rts
  1124.  
  1125. *
  1126. * Einstellungen speichern
  1127. *
  1128.  
  1129. SaveThePrefs    bsr    GetGadgets
  1130.  
  1131.         move.l    _DOSBase,a6        ;Datei öffnen
  1132.         move.l    #PrefsFileName,d1
  1133.         move.l    #MODE_NEWFILE,d2
  1134.         JSRLIB    Open
  1135.         move.l    d0,d6
  1136.         beq    2$
  1137.  
  1138.         move.l    d6,d1            ;Einstellungen schreiben
  1139.         move.l    #ThePrefs,d2
  1140.         move.l    #PrefsLength,d3
  1141.         JSRLIB    Write
  1142.  
  1143.         move.l    d6,d1            ;Datei schließene
  1144.         JSRLIB    Close
  1145.  
  1146.         move.l    _IconBase,a6        ;Icon bereits vorhanden?
  1147.         lea    PrefsFileName,a0
  1148.         JSRLIB    GetDiskObject
  1149.         tst.l    d0
  1150.         beq    1$
  1151.         move.l    d0,a0            ;Ja, dann nichts machen
  1152.         JSRLIB    FreeDiskObject
  1153.         rts
  1154.  
  1155. 1$        lea    PrefsFileName,a0    ;Nein, Icon erzeugen
  1156.         lea    PrefsIcon,a1
  1157.         JSRLIB    PutDiskObject
  1158. 2$        rts
  1159.  
  1160. *
  1161. * Requester entsprechend dem Rückgabewert von ChangedIEC anzeigen
  1162. * d0: Rückgabewert
  1163. *
  1164.  
  1165. IECErrorReq    tst.l    d0
  1166.         beq    1$
  1167.         cmp.l    #1,d0
  1168.         bne    2$
  1169.         lea    NoParPortReq,a1
  1170.         bra    3$
  1171. 2$        lea    NoTimerReq,a1
  1172. 3$        move.l    a6,-(sp)
  1173.         move.l    _IntuitionBase,a6
  1174.         sub.l    a0,a0
  1175.         move.l    a0,a2
  1176.         move.l    a0,a3
  1177.         JSRLIB    EasyRequestArgs
  1178.         move.l    (sp)+,a6
  1179. 1$        rts
  1180.  
  1181.  
  1182. **
  1183. ** Konstanten
  1184. **
  1185.  
  1186. ; Strings
  1187. Version        VERSTAG
  1188. UtilityName    dc.b    "utility.library",0
  1189. IntuiName    dc.b    "intuition.library",0
  1190. GfxName        dc.b    "graphics.library",0
  1191. GadToolsName    dc.b    "gadtools.library",0
  1192. AslName        dc.b    "asl.library",0
  1193. IconName    dc.b    "icon.library",0
  1194. EGSName        dc.b    "egs.library",0
  1195. VilIntuiName    dc.b    "vilintuisup.library",0
  1196. CiaResName    dc.b    "ciaa.resource",0
  1197. MiscResName    dc.b    "misc.resource",0
  1198.  
  1199. PrefsFileName    dc.b    "PROGDIR:Frodo Prefs",0
  1200. BasicFileName    dc.b    "PROGDIR:Basic ROM",0
  1201. KernalFileName    dc.b    "PROGDIR:Kernal ROM",0
  1202. CharFileName    dc.b    "PROGDIR:Char ROM",0
  1203.  
  1204. ReqTitle    dc.b    "Frodo C64 Emulator",0
  1205. ReqGads        dc.b    "Beenden",0
  1206. ReqGads2    dc.b    "Macht nichts",0
  1207. ScreenHailText    dc.b    "Wählen Sie einen Bildschirmmodus",0
  1208. DirHailText    dc.b    "Wählen Sie ein Verzeichnis",0
  1209. No68020Text    dc.b    "Frodo benötigt mindestens",10
  1210.         dc.b    "einen 68020 Prozessor.",0
  1211. NoMemText    dc.b    "Es steht nicht genügend Speicher zum",10
  1212.         dc.b    "Starten des Emulators zur Verfügung.",0
  1213. NoScreenText    dc.b    "Der C64-Bildschirm kann nicht",10
  1214.         dc.b    "eingerichtet werden.",0
  1215. NoEGSText    dc.b    "EGS ist auf Ihrem Amiga nicht",10
  1216.         dc.b    "installiert.",10
  1217.         dc.b    "Bitte wählen Sie 'Amiga' oder",10
  1218.         dc.b    "'Picasso' als Bildschirmtyp.",0
  1219. NoVilIntuiText    dc.b    "Die 'vilintuisup.library' ist",10
  1220.         dc.b    "auf Ihrem Amiga nicht installiert.",10
  1221.         dc.b    "Bitte wählen Sie 'Amiga' oder",10
  1222.         dc.b    "'EGS' als Bildschirmtyp.",0
  1223. NoDisplayIDText    dc.b    "Der gewählte Bildschirmmodus",10
  1224.         dc.b    "ist auf Ihrem Amiga nicht verfügbar.",0
  1225. ScrTooSmallText    dc.b    "Der von Ihnen gewählte Bildschirmmodus",10
  1226.         dc.b    "hat eine zu geringe Auflösung.",10
  1227.         dc.b    "Sie muß mindestens 384×288 betragen.",0
  1228. NoKernalText    dc.b    "Die Datei 'Kernal ROM' fehlt",10
  1229.         dc.b    "oder ist beschädigt.",0
  1230. NoBasicText    dc.b    "Die Datei 'Basic ROM' fehlt",10
  1231.         dc.b    "oder ist beschädigt.",0
  1232. NoCharText    dc.b    "Die Datei 'Char ROM' fehlt",10
  1233.         dc.b    "oder ist beschädigt.",0
  1234. NoParPortText    dc.b    "Der parallele Port ist zur Zeit",10
  1235.         dc.b    "von einem anderen Programm belegt.",10
  1236.         dc.b    "Die Benutzung von IEC-Geräten",10
  1237.         dc.b    "ist daher nicht möglich.",0
  1238. NoTimerText    dc.b    "Frodo kann keinen freien CIA-Timer finden.",10
  1239.         dc.b    "Die Benutzung von IEC-Geräten ist daher",10
  1240.         dc.b    "nicht möglich.",0
  1241.         CNOP    0,4
  1242.  
  1243. ; Requester
  1244. No68020Req    dc.l    20,0
  1245.         dc.l    ReqTitle
  1246.         dc.l    No68020Text
  1247.         dc.l    ReqGads
  1248. NoMemReq    dc.l    20,0
  1249.         dc.l    ReqTitle
  1250.         dc.l    NoMemText
  1251.         dc.l    ReqGads
  1252. NoScreenReq    dc.l    20,0
  1253.         dc.l    ReqTitle
  1254.         dc.l    NoScreenText
  1255.         dc.l    ReqGads
  1256. NoEGSReq    dc.l    20,0
  1257.         dc.l    ReqTitle
  1258.         dc.l    NoEGSText
  1259.         dc.l    ReqGads
  1260. NoVilIntuiReq    dc.l    20,0
  1261.         dc.l    ReqTitle
  1262.         dc.l    NoVilIntuiText
  1263.         dc.l    ReqGads
  1264. NoDisplayIDReq    dc.l    20,0
  1265.         dc.l    ReqTitle
  1266.         dc.l    NoDisplayIDText
  1267.         dc.l    ReqGads
  1268. ScrTooSmallReq    dc.l    20,0
  1269.         dc.l    ReqTitle
  1270.         dc.l    ScrTooSmallText
  1271.         dc.l    ReqGads
  1272. NoKernalReq    dc.l    20,0
  1273.         dc.l    ReqTitle
  1274.         dc.l    NoKernalText
  1275.         dc.l    ReqGads
  1276. NoBasicReq    dc.l    20,0
  1277.         dc.l    ReqTitle
  1278.         dc.l    NoBasicText
  1279.         dc.l    ReqGads
  1280. NoCharReq    dc.l    20,0
  1281.         dc.l    ReqTitle
  1282.         dc.l    NoCharText
  1283.         dc.l    ReqGads
  1284. NoParPortReq    dc.l    20,0
  1285.         dc.l    ReqTitle
  1286.         dc.l    NoParPortText
  1287.         dc.l    ReqGads2
  1288. NoTimerReq    dc.l    20,0
  1289.         dc.l    ReqTitle
  1290.         dc.l    NoTimerText
  1291.         dc.l    ReqGads2
  1292.  
  1293.  
  1294. **
  1295. ** Datenbereich
  1296. **
  1297.  
  1298. _UtilityBase    dc.l    0
  1299. _IntuitionBase    dc.l    0
  1300. _GfxBase    dc.l    0
  1301. _GadToolsBase    dc.l    0
  1302. _AslBase    dc.l    0
  1303. _IconBase    dc.l    0
  1304. _EGSBase    dc.l    0
  1305. _VilIntuiBase    dc.l    0
  1306. _CiaBase    dc.l    0
  1307. _MiscBase    dc.l    0
  1308.  
  1309. MainTask    dc.l    0    ;Emulator-Haupttask
  1310.  
  1311. ScreenRequester    dc.l    0    ;ScreenMode-Requester
  1312. DirRequester    dc.l    0    ;Directory-Requester
  1313.  
  1314. RAMBlock    dc.l    0    ;Zeiger auf Speicherbereich
  1315.  
  1316. TheClass    dc.l    0    ;Für Preferences
  1317. TheGadget    dc.l    0
  1318. TheCode        dc.w    0
  1319.  
  1320. PrefsFromEmul    dc.w    0    ;#0: Einstellungen vom Emulator aus aufgerufen
  1321.  
  1322. ; Prefs-Icon
  1323. PrefsIcon    dc.w    WB_DISKMAGIC,WB_DISKVERSION
  1324.         dc.l    0
  1325.         dc.w    0,0,54,23
  1326.         dc.w    4,1,1
  1327.         dc.l    PrefsI1,0,0,0,0
  1328.         dc.w    0
  1329.         dc.l    1
  1330.         dc.b    WBPROJECT,0
  1331.         dc.l    0,0
  1332.         dc.l    NO_ICON_POSITION,NO_ICON_POSITION
  1333.         dc.l    0,0,0
  1334.  
  1335. ; Image für Prefs-Icon
  1336. PrefsI1        dc.w    0,0,54,22,8
  1337.         dc.l    PrefsI1Data
  1338.         dc.b    255,0
  1339.         dc.l    0
  1340.  
  1341. ; Tags zum Setzen von Gadgets
  1342. SetDir8Tags    dc.l    GTST_String,PDir8
  1343.         dc.l    0,0
  1344. SetDir9Tags    dc.l    GTST_String,PDir9
  1345.         dc.l    0,0
  1346. SetDir10Tags    dc.l    GTST_String,PDir10
  1347.         dc.l    0,0
  1348. SetDir11Tags    dc.l    GTST_String,PDir11
  1349.         dc.l    0,0
  1350. SetIntegerTags    dc.l    GTIN_Number
  1351. SetIntTagsVal    dc.l    0
  1352.         dc.l    0,0
  1353. SetCheckTags    dc.l    GTCB_Checked,-1
  1354.         dc.l    0,0
  1355. SetCycleTags    dc.l    GTCY_Active
  1356. SetCycTagsVal    dc.l    0
  1357.         dc.l    0,0
  1358. SetDIDTags    dc.l    GTTX_Text,ModeNameBuf+16
  1359.         dc.l    0,0
  1360. DisableTags    dc.l    GA_Disabled,-1
  1361.         dc.l    0,0
  1362. EnableTags    dc.l    GA_Disabled,0
  1363.         dc.l    0,0
  1364.  
  1365. ; Tags für ScreenMode-Requester
  1366. ScreenReqTags    dc.l    ASLSM_TitleText,ScreenHailText
  1367.         dc.l    ASLSM_SleepWindow,-1
  1368.         dc.l    0,0
  1369.  
  1370. DoScreenReqTags    dc.l    ASLSM_InitialDisplayID
  1371. ScreenReqID    dc.l    0
  1372.         dc.l    ASLSM_Window
  1373. ScreenReqWindow    dc.l    0
  1374.         dc.l    0,0
  1375.  
  1376. ; Tags für den Directory-Requester
  1377. DirReqTags    dc.l    ASLFR_TitleText,DirHailText
  1378.         dc.l    ASLFR_SleepWindow,-1
  1379.         dc.l    ASLFR_Flags2,FRF_REJECTICONS|FRF_DRAWERSONLY
  1380.         dc.l    0,0
  1381.  
  1382. DoDirReqTags    dc.l    ASLFR_InitialDrawer,DirName
  1383.         dc.l    ASLFR_Window
  1384. DirReqWindow    dc.l    0
  1385.         dc.l    0,0
  1386.  
  1387.  
  1388. **
  1389. ** Icon-Daten
  1390. **
  1391.  
  1392.         SECTION    "CHIPDATA",DATA,CHIP
  1393.  
  1394. PrefsI1Data    dc.w    $0000,$0000,$0000,$0400,$0000,$0000,$0000,$0C00
  1395.         dc.w    $0003,$FFC0,$0000,$0C00,$000C,$0030,$0000,$0C00
  1396.         dc.w    $0010,$7E08,$0000,$0C00,$0020,$8104,$0000,$0C00
  1397.         dc.w    $0020,$4104,$0000,$0C00,$0020,$4104,$0000,$0C00
  1398.         dc.w    $0010,$8204,$0000,$0C00,$000F,$0C08,$0000,$0C00
  1399.         dc.w    $0000,$3010,$0000,$0C00,$0000,$4060,$0000,$0C00
  1400.         dc.w    $0000,$8180,$0000,$0C00,$0001,$0E00,$0000,$0C00
  1401.         dc.w    $0000,$8400,$0000,$0C00,$0000,$7800,$0000,$0C00
  1402.         dc.w    $0000,$8400,$0000,$0C00,$0000,$8400,$0000,$0C00
  1403.         dc.w    $0000,$7800,$0000,$0C00,$0000,$0000,$0000,$0C00
  1404.         dc.w    $0000,$0000,$0000,$0C00,$7FFF,$FFFF,$FFFF,$FC00
  1405.  
  1406.         dc.w    $FFFF,$FFFF,$FFFF,$F800,$D555,$5557,$D555,$5000
  1407.         dc.w    $D554,$001F,$F555,$5000,$D553,$FFCF,$F555,$5000
  1408.         dc.w    $D54F,$81F7,$F555,$5000,$D55F,$54FB,$F555,$5000
  1409.         dc.w    $D55F,$94FB,$FFD5,$5000,$D55F,$94F9,$7FF5,$5000
  1410.         dc.w    $D54F,$55F9,$7FD5,$5000,$D550,$53F5,$7FD5,$5000
  1411.         dc.w    $D555,$4FE5,$5F55,$5000,$D555,$3F95,$60D5,$5000
  1412.         dc.w    $D555,$7E7D,$6055,$5000,$D554,$F1FD,$6035,$5000
  1413.         dc.w    $D555,$79FF,$FFD5,$5000,$D555,$05FF,$F555,$5000
  1414.         dc.w    $D555,$797F,$F555,$5000,$D555,$797F,$F555,$5000
  1415.         dc.w    $D555,$055F,$F555,$5000,$D555,$5557,$D555,$5000
  1416.         dc.w    $D555,$5555,$5555,$5000,$8000,$0000,$0000,$0000
  1417.  
  1418.         dc.w    $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
  1419.         dc.w    $0000,$0007,$C000,$0000,$0000,$000F,$E000,$0000
  1420.         dc.w    $0000,$0007,$E000,$0000,$0000,$0003,$E000,$0000
  1421.         dc.w    $0000,$0000,$6000,$0000,$0000,$0000,$1FC0,$0000
  1422.         dc.w    $0000,$0000,$1F80,$0000,$0000,$0000,$1F00,$0000
  1423.         dc.w    $0000,$0000,$0000,$0000,$0000,$0000,$1F00,$0000
  1424.         dc.w    $0000,$0070,$1F80,$0000,$0000,$00F0,$1FC0,$0000
  1425.         dc.w    $0000,$00FC,$6000,$0000,$0000,$007F,$E000,$0000
  1426.         dc.w    $0000,$003F,$E000,$0000,$0000,$001F,$E000,$0000
  1427.         dc.w    $0000,$0007,$C000,$0000,$0000,$0000,$0000,$0000
  1428.         dc.w    $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
  1429.  
  1430.         dc.w    $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
  1431.         dc.w    $0000,$0007,$C000,$0000,$0000,$000F,$E000,$0000
  1432.         dc.w    $0000,$0007,$E000,$0000,$0000,$0003,$E000,$0000
  1433.         dc.w    $0000,$0000,$6000,$0000,$0000,$0000,$1FC0,$0000
  1434.         dc.w    $0000,$0000,$1F80,$0000,$0000,$0000,$1F00,$0000
  1435.         dc.w    $0000,$0000,$0000,$0000,$0000,$0000,$1F00,$0000
  1436.         dc.w    $0000,$0070,$1F80,$0000,$0000,$00F0,$1FC0,$0000
  1437.         dc.w    $0000,$00FC,$6000,$0000,$0000,$007F,$E000,$0000
  1438.         dc.w    $0000,$003F,$E000,$0000,$0000,$001F,$E000,$0000
  1439.         dc.w    $0000,$0007,$C000,$0000,$0000,$0000,$0000,$0000
  1440.         dc.w    $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
  1441.  
  1442.         dc.w    $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
  1443.         dc.w    $0000,$0007,$C000,$0000,$0000,$000F,$E000,$0000
  1444.         dc.w    $0000,$0007,$E000,$0000,$0000,$0003,$E000,$0000
  1445.         dc.w    $0000,$0000,$6000,$0000,$0000,$0000,$1FC0,$0000
  1446.         dc.w    $0000,$0000,$1F80,$0000,$0000,$0000,$1F00,$0000
  1447.         dc.w    $0000,$0000,$0000,$0000,$0000,$0000,$1F00,$0000
  1448.         dc.w    $0000,$0070,$1F80,$0000,$0000,$00F0,$1FC0,$0000
  1449.         dc.w    $0000,$00FC,$6000,$0000,$0000,$007F,$E000,$0000
  1450.         dc.w    $0000,$003F,$E000,$0000,$0000,$001F,$E000,$0000
  1451.         dc.w    $0000,$0007,$C000,$0000,$0000,$0000,$0000,$0000
  1452.         dc.w    $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
  1453.  
  1454.         dc.w    $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
  1455.         dc.w    $0000,$0007,$C000,$0000,$0000,$000F,$E000,$0000
  1456.         dc.w    $0000,$0007,$E000,$0000,$0000,$0003,$E000,$0000
  1457.         dc.w    $0000,$0000,$6000,$0000,$0000,$0000,$1FC0,$0000
  1458.         dc.w    $0000,$0000,$1F80,$0000,$0000,$0000,$1F00,$0000
  1459.         dc.w    $0000,$0000,$0000,$0000,$0000,$0000,$1F00,$0000
  1460.         dc.w    $0000,$0070,$1F80,$0000,$0000,$00F0,$1FC0,$0000
  1461.         dc.w    $0000,$00FC,$6000,$0000,$0000,$007F,$E000,$0000
  1462.         dc.w    $0000,$003F,$E000,$0000,$0000,$001F,$E000,$0000
  1463.         dc.w    $0000,$0007,$C000,$0000,$0000,$0000,$0000,$0000
  1464.         dc.w    $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
  1465.  
  1466.         dc.w    $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
  1467.         dc.w    $0000,$0007,$C000,$0000,$0000,$000F,$E000,$0000
  1468.         dc.w    $0000,$0007,$E000,$0000,$0000,$0003,$E000,$0000
  1469.         dc.w    $0000,$0000,$6000,$0000,$0000,$0000,$1FC0,$0000
  1470.         dc.w    $0000,$0000,$1F80,$0000,$0000,$0000,$1F00,$0000
  1471.         dc.w    $0000,$0000,$0000,$0000,$0000,$0000,$1F00,$0000
  1472.         dc.w    $0000,$0070,$1F80,$0000,$0000,$00F0,$1FC0,$0000
  1473.         dc.w    $0000,$00FC,$6000,$0000,$0000,$007F,$E000,$0000
  1474.         dc.w    $0000,$003F,$E000,$0000,$0000,$001F,$E000,$0000
  1475.         dc.w    $0000,$0007,$C000,$0000,$0000,$0000,$0000,$0000
  1476.         dc.w    $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
  1477.  
  1478.         dc.w    $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
  1479.         dc.w    $0000,$0007,$C000,$0000,$0000,$000F,$E000,$0000
  1480.         dc.w    $0000,$0007,$E000,$0000,$0000,$0003,$E000,$0000
  1481.         dc.w    $0000,$0000,$6000,$0000,$0000,$0000,$1FC0,$0000
  1482.         dc.w    $0000,$0000,$1F80,$0000,$0000,$0000,$1F00,$0000
  1483.         dc.w    $0000,$0000,$0000,$0000,$0000,$0000,$1F00,$0000
  1484.         dc.w    $0000,$0070,$1F80,$0000,$0000,$00F0,$1FC0,$0000
  1485.         dc.w    $0000,$00FC,$6000,$0000,$0000,$007F,$E000,$0000
  1486.         dc.w    $0000,$003F,$E000,$0000,$0000,$001F,$E000,$0000
  1487.         dc.w    $0000,$0007,$C000,$0000,$0000,$0000,$0000,$0000
  1488.         dc.w    $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
  1489.  
  1490.  
  1491. **
  1492. ** Nicht initialisierte Daten
  1493. **
  1494.  
  1495.         SECTION    "BSS",BSS
  1496. ModeNameBuf    ds.b    nif_SIZEOF    ;Puffer für GetDisplayInfoData
  1497. DirName        ds.b    256        ;Puffer für Directory-Requester
  1498.  
  1499. ; Einstellungen
  1500. ThePrefs
  1501. Pdummy        ds.w    1
  1502. PNormalCycles    ds.w    1
  1503. PBadLineCycles    ds.w    1
  1504. PCIACycles    ds.w    1
  1505. PJoystick1On    ds.w    1
  1506. PJoystick2On    ds.w    1
  1507. PJoystickSwap    ds.w    1
  1508. PDisplayID    ds.l    1
  1509. PScreenType    ds.w    1
  1510. PDir8        ds.b    256
  1511. PDir9        ds.b    256
  1512. PDir10        ds.b    256
  1513. PDir11        ds.b    256
  1514. PDrv8IsIEC    ds.w    1
  1515. PDrv9IsIEC    ds.w    1
  1516. PDrv10IsIEC    ds.w    1
  1517. PDrv11IsIEC    ds.w    1
  1518. PUseSIDCard    ds.w    1
  1519. POtherIEC    ds.w    1
  1520. PKeyboardYZ    ds.w    1
  1521. PrefsLength    = *-ThePrefs
  1522.  
  1523.         END
  1524.